<template>
  <div class="login">
    <input type="text" placeholder="请输入用户名" v-model="username" />
    <button @click="handleEnterHome">确认</button>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  methods: {
    handleEnterHome() {
      localStorage.setItem("username", this.username);
      this.$router.push({
        path: "/",
      });
    },
  },
};
</script>